{// 引入标签库 }
<tagLib name="html" />
<include file="Public:header" />
<include file="Public:new" />
<load href='__TMPL__Common/js/jquery.bgiframe.js' />
<load href='__TMPL__Common/js/jquery.weebox.js' />
<load href='__TMPL__Common/js/user.js' />
<load href='__TMPL__Common/js/deal.js' />
<load href='__TMPL__Common/style/weebox.css' />
<script type="text/javascript" src="__TMPL__Common/js/calendar/calendar.php?lang=zh-cn" ></script>
<load href='__TMPL__Common/js/calendar/calendar.css' />
<load href='__TMPL__Common/js/calendar/calendar.js' />
<div class="main">
<div class="main_title_list"><div class="list-line-ico"></div>主播列表 <a href="javascript:clear_view_count()" title="清空累计观看 ">清空累计观看</a>（必须非运营时候清除，否则导致数据库卡死）</div>
<php>
	function get_level($level){
		$user_level = $GLOBALS['db']->getOne("select `name` from ".DB_PREFIX."user_level where level = '".intval($level)."'");
		return $user_level;
	}
	function head_image($head_image){
		 if($head_image==''){
			return "<a style='height:35px;width:35px;'/>头像未上传</a>";
		}else{
			return "<img src='".$head_image."' style='height:35px;width:35px;'/>";
		}
	}
    function get_online($is_online){
        if($is_online==1){
            return '是';
        }else{
            return '否';
        }
    }

    function forbid_msg($id,$user){
        if($user['is_nospeaking']==1){
            return "<a href=\"javascript:forbid_msg('".$id."')\">解除im全局禁言</a>";
        }else{
            return "<a href=\"javascript:forbid_msg('".$id."')\">im全局禁言</a>";
        }
    }
    function get_is_nospeaking($is_nospeaking){
        if($is_nospeaking){
            return "是";
        }else{
            return "否";
        }
    }
    function get_distribution_log($id,$distribution_log){
        if($distribution_log){
            return "<a href=\"javascript:distribution_log('".$id."')\">分销奖励</a>";
        }
        return "";
    }
    function get_distribution_user($id,$distribution_log){
        if($distribution_log){
        return "<a href=\"javascript:distribution_user('".$id."')\">分销子用户</a>";
        }
        return "";
    }
    function get_coins($id,$coins){
        $open_game = intval(defined('OPEN_GAME_MODULE') && OPEN_GAME_MODULE);
        $open_diamond = intval(defined('OPEN_DIAMOND_GAME_MODULE') && OPEN_DIAMOND_GAME_MODULE);
        if($open_game && !$open_diamond){
            return "<a href=\"javascript:coins('".$id."')\">游戏币管理</a>";
        }
        return "";
    }
    function weixin_distribution($id){
        if(defined('WEIXIN_DISTRIBUTION') && WEIXIN_DISTRIBUTION){
            return "<a href=\"javascript:weixin_distribution('".$id."')\">微信分销</a>";
        }
        return '';
    }
    function get_game_rate($id)
    {
        if (intval(defined('OPEN_GAME_MODULE') && OPEN_GAME_MODULE) && defined('USER_GAME_RATE') && USER_GAME_RATE) {
            {
                return "<a href=\"javascript:game_rate('" . $id . "')\">游戏干预系数</a>";
            }
            return "";
        }
    }
    function get_game_distribution($id){
        if(intval(defined('GAME_DISTRIBUTION') && GAME_DISTRIBUTION)){
            return "<a href=\"javascript:game_distribution('".$id."')\">游戏分销系数</a>";
        }
        return "";
    }
    function get_game_distribution_detail($id){
        if(intval(defined('GAME_DISTRIBUTION') && GAME_DISTRIBUTION)){
            return "<a href=\"javascript:game_distribution_detail('".$id."')\">游戏分销记录</a>";
        }
        return "";
    }
    function get_goods($id,$goods){
        if($goods){
            return "<a href=\"javascript:goods('".$id."')\">商品管理</a>";
        }
        return "";
    }
    function forbid_game($id,$open_game){
    if(intval(defined('OPEN_PLUGIN') && OPEN_PLUGIN)){
    if($open_game==0){
    return "<a href=\"javascript:forbid_game('".$id."')\">禁游戏</a>";
    }else{
    return "<a href=\"javascript:forbid_game('".$id."')\">取消禁游戏</a>";
    }
    }
    }
    function forbid_pay($id,$open_pay){
    if(intval(defined('OPEN_PLUGIN') && OPEN_PLUGIN)){
    if($open_pay==0){
    return "<a href=\"javascript:forbid_pay('".$id."')\">禁付费</a>";
    }else{
    return "<a href=\"javascript:forbid_pay('".$id."')\">取消禁付费</a>";
    }
    }
    }
    function forbid_auction($id,$open_auction){
    if(intval(defined('OPEN_PLUGIN') && OPEN_PLUGIN)){
    if($open_auction==0){
    return "<a href=\"javascript:forbid_auction('".$id."')\">禁竞拍</a>";
    }else{
    return "<a href=\"javascript:forbid_auction('".$id."')\">取消禁竞拍</a>";
    }
    }
    }
    function invitation_code($id){
        if(intval(defined('ENTER_INVITATION_CODE') && ENTER_INVITATION_CODE)){
            return "<a href=\"javascript:invitation_code('".$id."')\">邀请码</a>";
        }
        return "";
    }
    function get_open_invite_code($id){
        if(intval(defined('OPEN_INVITE_CODE') && OPEN_INVITE_CODE)){
            return "<a href=\"javascript:invite_distribution_log('".$id."')\">邀请码奖励</a>";
        }
        return "";
    }
</php>
<!-- <div class="button_row">
	<input type="button" class="button" value="{%ADD}" onclick="add();" />
</div>
 -->
    <script>
        function forbid_msg($id){
            var r=confirm("确定要修改状态？");
            if (r==true){
                $.ajax({
                    url: ROOT+"?"+VAR_MODULE+"="+MODULE_NAME+"&"+VAR_ACTION+"=forbid_msg&user_id="+$id,
                    data: "",
                    dataType: "json",
                    success: function(obj){
                        alert(obj.info);
                        func();
                        function func(){
                            if(obj.status==1){
                                location.href=location.href;
                            }
                        }
                    }
                });
            }else{

            }
        }

        function goods(id){
            location.href = ROOT+"?"+VAR_MODULE+"="+MODULE_NAME+"&"+VAR_ACTION+"=goods&user_id="+id;
        }
		
		function clear_view_count()
	    {
	        if(confirm("确定要清空累计观看？"))
	            $.ajax({
	                url: ROOT+"?"+VAR_MODULE+"="+MODULE_NAME+"&"+VAR_ACTION+"=clear_view_count",
	                data: "ajax=1",
	                dataType: "json",
	                success: function(obj){
	                    alert(obj.info);
	                    func();
	                    function func(){
	                        if(obj.status==1){
	                            location.href=location.href;
	                        }
	                    }
	                }
	            });
	    }
        function forbid_game($id){
            var r=confirm("确定要修改状态？");
            if (r==true){
                $.ajax({
                    url: ROOT+"?"+VAR_MODULE+"="+MODULE_NAME+"&"+VAR_ACTION+"=forbid_game&user_id="+$id,
                    data: "",
                    dataType: "json",
                    success: function(obj){
                        alert(obj.info);
                        func();
                        function func(){
                            if(obj.status==1){
                                location.href=location.href;
                            }
                        }
                    }
                });
            }else{

            }
        }
        function forbid_pay($id){
            var r=confirm("确定要修改状态？");
            if (r==true){
                $.ajax({
                    url: ROOT+"?"+VAR_MODULE+"="+MODULE_NAME+"&"+VAR_ACTION+"=forbid_pay&user_id="+$id,
                    data: "",
                    dataType: "json",
                    success: function(obj){
                        alert(obj.info);
                        func();
                        function func(){
                            if(obj.status==1){
                                location.href=location.href;
                            }
                        }
                    }
                });
            }else{

            }
        }
        function forbid_auction($id){
            var r=confirm("确定要修改状态？");
            if (r==true){
                $.ajax({
                    url: ROOT+"?"+VAR_MODULE+"="+MODULE_NAME+"&"+VAR_ACTION+"=forbid_auction&user_id="+$id,
                    data: "",
                    dataType: "json",
                    success: function(obj){
                        alert(obj.info);
                        func();
                        function func(){
                            if(obj.status==1){
                                location.href=location.href;
                            }
                        }
                    }
                });
            }else{

            }
        }
    </script>
<div class="search_row">
	<form name="search" action="__APP__" method="get" class="clearfix">
	<div>主播ID：<input type="text" class="textbox" name="id" value="{:trim($_REQUEST['id'])}" style="width:100px;" /></div>
	<div>主播类型：<select name="is_authentication">
	<option value="-1" selected="selected">所有</option>
	<option value="0,1,3" <if condition="$_REQUEST['is_authentication'] eq 0 "> selected="selected"</if>>普通主播</option>
	<option value="2"<if condition="$_REQUEST['is_authentication'] eq 2"> selected="selected"</if>>认证主播</option>
	</select></div>
    <if condition="$open_vip eq 1">
        <div>是否VIP：<select name="is_vip">
        <option value="" selected="selected">所有</option>
        <option value="0" <if condition="$_REQUEST['is_vip'] eq 0 && $_REQUEST['is_vip'] neq ''"> selected="selected"</if>>否</option>
        <option value="1"<if condition="$_REQUEST['is_vip'] eq 1"> selected="selected"</if>>是</option>
    </select></div>
    </if>
	<div>手机号：<input type="text" class="textbox" name="mobile" value="{:trim($_REQUEST['mobile'])}" style="width:100px;" /></div>
	<div>主播昵称：<input type="text" class="textbox" name="nick_name" value="{:trim($_REQUEST['nick_name'])}" style="width:100px;" /></div>
	<div>注册时间：<span><input type="text" class="textbox" name="create_time_1" id="create_time_1" value="{$_REQUEST['create_time_1']}" onfocus="this.blur(); return showCalendar('create_time_1', '%Y-%m-%d', false, false, 'btn_create_time_1');" /><input type="button" class="button" id="btn_create_time_1" value="{%SELECT_TIME}" onclick="return showCalendar('create_time_1', '%Y-%m-%d', false, false, 'btn_create_time_1');" /></span> - <span><input type="text" class="textbox" name="create_time_2" id="create_time_2" value="{$_REQUEST['create_time_2']}" onfocus="this.blur(); return showCalendar('create_time_2', '%Y-%m-%d', false, false, 'btn_create_time_2');" /><input type="button" class="button" id="btn_create_time_2" value="{%SELECT_TIME}" onclick="return showCalendar('create_time_2', '%Y-%m-%d', false, false, 'btn_create_time_2');" /></span><input type="hidden" value="UserGeneral" name="m" /><input type="hidden" value="index" name="a" /><input type="submit" class="button" value="{%SEARCH}" />
    <input type="button" class="button" value="{%EXPORT}" onclick="export_csv();" />
    </div>
	</form>
</div>
    <if condition="(USER_PROP_CLOSED eq 1)">
            <html:list
                    id="dataTable"
                    style="dataTable"
                    name="user"
                    action="true"
                    datasource="list"
                    show="id:主播ID
        ,nick_name:{%NICK_NAME}:edit
        ,head_image|head_image:{%USER_HEADIMAGE}
        ,diamonds:{%DIAMONDS}
        ,use_diamonds:{%USER_DIAMONDS}
        ,ticket:{%USER_TICKET}
        ,useable_ticket:{%USEABLE_TICKET}
        ,u_score:{%USER_SCORE}
        ,focus_count:{%USER_FOCUS}:focus_list
        ,fans_count:{%USER_FANS}:fans_list
        ,user_level|get_level=$user['user_level']:{%LEVEL}
        ,is_ban|get_is_ban=$user['id']:{%IS_BAN}
        ,luck_num:{%LUCK_NUM}
        ,view_count:累计观看
        ,login_ip:登录IP
        ,is_effect|get_is_effect=$user['id']:{%IS_EFFECT}
        ,is_hot_on|get_is_hot_on=$user['id']:{%IS_HOT_ON}
        ,is_nospeaking|get_is_nospeaking:im全局禁言"
                    actionlist="edit:{%EDIT},id|forbid_game=$user['open_game'],id|forbid_pay=$user['open_pay'],id|forbid_auction=$user['open_auction'], account:{%USER_ACCOUNT},account_detail:{%USER_ACCOUNT_DETAIL},contribution_list:{%TICKET_CONTRIBUTION},prop:{%USER_PROP_DETAIL},closed_prop:{%USER_PROP_CLOSED},id|forbid_msg=$user,id|get_distribution_log=$user['distribution_log'],id|get_distribution_user=$user['distribution_log'],id|get_coins=$user['coins'],id|get_game_rate,id|get_game_distribution,id|get_game_distribution_detail,id|invitation_code,id|get_goods=$user['goods'],id|get_open_invite_code,id|weixin_distribution" />

    <else/>
            <html:list
                    id="dataTable"
                    style="dataTable"
                    name="user"
                    action="true"
                    datasource="list"
                    show="id:主播ID
        ,nick_name:{%NICK_NAME}:edit
        ,head_image|head_image:{%USER_HEADIMAGE}
        ,diamonds:{%DIAMONDS}
        ,use_diamonds:{%USER_DIAMONDS}
        ,ticket:{%USER_TICKET}
        ,useable_ticket:{%USEABLE_TICKET}
        ,u_score:{%USER_SCORE}
        ,focus_count:{%USER_FOCUS}:focus_list
        ,fans_count:{%USER_FANS}:fans_list
        ,user_level|get_level=$user['user_level']:{%LEVEL}
        ,is_ban|get_is_ban=$user['id']:{%IS_BAN}
        ,luck_num:{%LUCK_NUM}
        ,view_count:累计观看
        ,login_ip:登录IP
        ,is_effect|get_is_effect=$user['id']:{%IS_EFFECT}
        ,is_hot_on|get_is_hot_on=$user['id']:{%IS_HOT_ON}
        ,is_nospeaking|get_is_nospeaking:im全局禁言"
                    actionlist="edit:{%EDIT},id|forbid_game=$user['open_game'],id|forbid_pay=$user['open_pay'],id|forbid_auction=$user['open_auction'], account:{%USER_ACCOUNT},account_detail:{%USER_ACCOUNT_DETAIL},contribution_list:{%TICKET_CONTRIBUTION},prop:{%USER_PROP_DETAIL},id|forbid_msg=$user,id|get_distribution_log=$user['distribution_log'],id|get_distribution_user=$user['distribution_log'],id|get_coins=$user['coins'],id|get_game_rate,id|get_game_distribution,id|get_game_distribution_detail,id|invitation_code,id|get_goods=$user['goods'],id|get_open_invite_code,id|weixin_distribution" />
    </if>

        <script type="text/javascript">
        function coins(user_id)
        {
            var url = ROOT + "?" + VAR_MODULE + "=Games&" + VAR_ACTION + "=addCoin&user_id=" + user_id;
            $.ajax({
                url: url,
                data: "ajax=1",
                dataType: "json",
                success: function(msg) {
                    if (msg.status == 0) {
                        alert(msg.info);
                    }
                },
                error: function() {
                    $.weeboxs.open(url, {
                        contentType: 'ajax',
                        showButton: false,
                        title: '游戏币管理',
                        width: 600,
                        height: 260
                    });
                }
            });
        }
        function game_rate(user_id)
        {
            var url = ROOT + "?" + VAR_MODULE + "=UserGeneral&" + VAR_ACTION + "=game_rate&user_id=" + user_id;
            $.ajax({
                url: url,
                data: "ajax=1",
                dataType: "json",
                success: function(msg) {
                    if (msg.status == 0) {
                        alert(msg.info);
                    }
                },
                error: function() {
                    $.weeboxs.open(url, {
                        contentType: 'ajax',
                        showButton: false,
                        title: '游戏干预系数',
                        width: 600,
                        height: 260
                    });
                }
            });
        }
        function game_distribution(user_id)
        {
            var url = ROOT + "?" + VAR_MODULE + "=UserGeneral&" + VAR_ACTION + "=game_distribution&user_id=" + user_id;
            $.ajax({
                url: url,
                data: "ajax=1",
                dataType: "json",
                success: function(msg) {
                    if (msg.status == 0) {
                        alert(msg.info);
                    }
                },
                error: function() {
                    $.weeboxs.open(url, {
                        contentType: 'ajax',
                        showButton: false,
                        title: '分销系数',
                        width: 600,
                        height: 260
                    });
                }
            });
        }
        function weixin_distribution(user_id)
        {
            var url = ROOT + "?" + VAR_MODULE + "=UserGeneral&" + VAR_ACTION + "=weixin_distribution&user_id=" + user_id;
            $.ajax({
                url: url,
                data: "ajax=1",
                dataType: "json",
                success: function(msg) {
                    if (msg.status == 0) {
                        alert(msg.info);
                    }
                },
                error: function() {
                    $.weeboxs.open(url, {
                        contentType: 'ajax',
                        showButton: false,
                        title: '微信分销',
                        width: 650,
                        height: 300
                    });
                }
            });
        }
        function game_distribution_detail(user_id) {
            window.location.href = ROOT + "?" + VAR_MODULE + "=UserGeneral&" + VAR_ACTION + "=game_distribution_detail&user_id=" + user_id;
        }
        function invitation_code(user_id) {
            var url = ROOT + "?" + VAR_MODULE + "=UserGeneral&" + VAR_ACTION + "=invitation_code&user_id=" + user_id;
            $.ajax({
                url: url,
                data: "ajax=1",
                dataType: "json",
                success: function(msg) {
                    if (msg.status == 0) {
                        alert(msg.info);
                    }
                },
                error: function() {
                    $.weeboxs.open(url, {
                        contentType: 'ajax',
                        showButton: false,
                        title: '邀请码',
                        width: 600,
                        height: 260
                    });
                }
            });
        }

        function closed_prop(id)
        {
            location.href = ROOT+"?"+VAR_MODULE+"="+MODULE_NAME+"&"+VAR_ACTION+"=closed_prop&id="+id;
        }
        function invite_distribution_log(id)
        {
            location.href = ROOT+"?"+VAR_MODULE+"="+MODULE_NAME+"&"+VAR_ACTION+"=invite_distribution_log&id="+id;
        }
    </script>

    <!-- del:{%DEL}, -->
	<!--<table class="dataTable">
		<tbody>
			<td colspan="14">
				<input type="button" class="button button-del" value="{%DEL}" onclick="del();" />
			</td>
		</tbody>
	</table>-->
<div class="page">{$page}</div>
</div>
<include file="Public:footer" />